package com.spt.springbootzhsx.service.suggest.Get_MovieToMovie_2;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

/**
 * 计算电影的共现关系
 */
public class GetMTM_Main {
    public static void domain() throws Exception {
        Configuration conf = new Configuration();

        Job job=Job.getInstance(conf,"计算电影的共现关系");
        job.setJarByClass(GetMTM_Main.class);
        job.setMapperClass(GetMTM_Mapper.class);
        //job.setReducerClass(GetMTM_Reducer.class);
        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(NullWritable.class);
        FileInputFormat.setInputPaths(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step01/part-r-00000"));
        FileOutputFormat.setOutputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step02"));
        job.waitForCompletion(true);
    }
}
